package com.markus.basic.设计模式.适配器模式;

/**
 * Author:markusZhang
 * Date:Create in 2020/8/30 12:26
 * todo:
 */
public class AudioPlayer implements MediaPlayer {
    MediaAdapter mediaAdapter;
    @Override
    public void play(String audioType, String fileName) {
        if ("mp3".equalsIgnoreCase(audioType)){
            System.out.println("mp3播放器播放文件："+fileName);
        }else if ("mp4".equalsIgnoreCase(audioType) || "vlc".equalsIgnoreCase(audioType)){
            mediaAdapter = new MediaAdapter(audioType);
            mediaAdapter.play(audioType,fileName);
        }
    }
}
